Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model, Module, and Class Naming Reduction/Refactor #190

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Model, Module, and Class Naming Reduction/Refactor #190

merged 1 commit into from
Feb 2, 2024

Conversation

davidvonthenen
Copy link
Contributor

@davidvonthenen davidvonthenen commented Jan 31, 2024

This PR makes the following changes:

  • Decouples the shared model components between Live and PreRecorded. This will introduce complexity when doing API versioning if they are tightly coupled. There may be a bump to v2/listen for the PreRecorded client but Live client will stay on v1/listen. This doesn't create a dependency on something that is shared between the two. (This will be cleaned up later... since there are some deprecated options exposed. Please see note below.)
  • Removes some redundancy in the model names. Since we have broken the model components into Live, PreRecorded, OnPrem, Manage, and soon to be Analyze... this removes the folder name Live from the class name, for example LiveTranscriptionResponse.cs -> TranscriptionResponse.cs since the class is scoped in the Live/v1/TranscriptionResponse.cs module.
  • This shortens the names for Schema and Response class names in the Manage model. Since nearly every Manage API call requires a project ID (with the exception of project calls), we can reduce the name of classes for convenience. For example, GetProjectInvitesResponse -> InvitesResponse and CreateProjectKeySchema -> KeySchema. The likelihood of the API creating naming collision is low since they probably wont change, and even if they do, we can:
    • Create a non-colliding name for the new class
    • Worst case (avoid at all costs), can now version the model and could more granular as needed.
  • Moves the remaining shared class DeepgramClientOptions from Shared/v1 to Authenticate/v1. This Authenticate/v1 can and will be shared with OnPrem auth in a bit.
  • Renames DeepgramHttpClient to Encapsulations since the function of the classes within do exactly that, plus to be inline with Abstractions name. For example, there is an HttpClientWrapper class that just encapsulates the native .NET HttpClient.

All unit tests pass with these updated names, modules, etc.

TODOs in subsequent PRs:

  • Fix the README
  • Perform an audit of existing Schema Options (input) and Response (output) based on the master document.

@davidvonthenen davidvonthenen changed the title Model, Module, and Class Naming Reduction Model, Module, and Class Naming Reduction/Refactor Jan 31, 2024
@davidvonthenen
Copy link
Contributor Author

Passing tests

Screenshot 2024-02-01 at 11 32 11

@davidvonthenen davidvonthenen merged commit f34d01a into deepgram:main Feb 2, 2024
4 checks passed
@davidvonthenen davidvonthenen deleted the model-naming-reduction branch February 2, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants